<form method="post" class="form-x one-form form-auto" id="form" action="{:U('/Class/sortClass')}">
<div class="panel one-box">
	<div class="table-responsive">
		<table id="table" class="table table-hover ">
			<tbody>
				<tr>
					<th width="100">编号</th>
					<th width="100">名称</th>
					<th width="100">排序</th>
					<th width="200">操作</th>
				</tr>
				
				<foreach name='caseSort' item='v'>
				<tr>
					<td>{$v.id}</td>
					<td>{$v.name}</td>
					<td>{$v.sort}</td>
					<td>
						<a class="button bg-blue button-small icon-pencil" title="修改" alt="修改" href="edit/id/{$v['id']}"></a>
						<a class="button bg-red button-small icon-trash-o js-del" title="删除" alt="删除" target2="delete/id/{$v['id']}" href="javascript:"></a>
					</td>	
				</tr>
				</foreach>
					
			</tbody>
		</table>
	</div>
</div>
</form>
<script>
    $(function($) {
    	// 绑定删除操作
        $(".js-del").click(function () {
            var delUrl = $(this).attr('target2');
            //询问框
			layer.confirm('您确定删除吗?', {
				icon: 4,
			    btn: ['确定','取消'] //按钮
			}, function(){
				$.post(delUrl,$("form").serialize(),function(data){
	                layer.msg(data.info, {icon: 1});
	                setTimeout("window.location.reload()",1000); // 让提示框停留一会
	            });
			});
        });

    });
</script>